package com.tiancai.pojo.po;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author tiancai
 * @since 2025-03-09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@Schema(name = "用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "用户id")
    private Long id;

    /**
     * 用户名
     */
    @Schema(description = "用户名")
    private String username;

    /**
     * 密码
     */
    @Schema(description = "密码")
    private String password;
    /**
     * 头像
     */
    @Schema(description = "头像")
    private String avatar;

    /**
     * 电话号码
     */
    @Schema(description = "电话号码")
    private String phone;

    /**
     * 邮箱
     */
    @Schema(description = "邮箱")
    private String email;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 注册时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill= FieldFill.INSERT)
    @Schema(description = "注册时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 拥有作品数
     */
    @Schema(description = "拥有作品数")
    private Integer ownCount;

    /**
     * 上传作品数
     */
    @Schema(description = "上传作品数")
    private Integer uploadCount;

    /**
     * 浏览作品数
     */
    @Schema(description = "浏览作品数")
    private Long viewCount;

    /**
     * 收藏作品数
     */
    @Schema(description = "收藏作品数")
    private Long collectCount;

    /**
     * 交易作品数
     */
    @Schema(description = "交易作品数")
    private Long tradeCount;

    /**
     * 被收藏作品数
     */
    @Schema(description = "被收藏作品数")
    private Long ownCollectCount;

    /**
     * 被赞数-评论
     */
    @Schema(description = "被赞数-评论")
    private Long ownLikeCount;

    /**
     * 个人信息码
     */
    @Schema(description = "个人信息码")
    private String code;

    /**
     * 被浏览数
     */
    @Schema(description = "被浏览数")
    private Long ownVisitCount;
}
